package com.fastjpa.entity;
import javax.persistence.*;

import com.efeichong.multiTenant.EnableMultiTenant;
import lombok.Getter;
import lombok.Setter;
import com.fastjpa.entity.Clazz;
import java.lang.Long;
import java.lang.String;
import java.lang.Integer;
import com.efeichong.logicDelete.LogicDelete;;
import com.efeichong.audit.InsertDefault;

/**
* @author admin
* @date 2022/07/17
* @description 学生
*/
@Setter
@Getter
@Entity(name = "student")
@Table(indexes = {
		@Index(name = "PRIMARY", columnList = "id", unique = true),
		@Index(name = "fk_stn_clazz_id", columnList = "clazz_id"),
})
@LogicDelete(column = "hasDel")
@EnableMultiTenant(column = "tenantId")
public class Student {
    /**班级**/
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "[clazz_id]")
    private Clazz clazz;

    /**id**/
    @Column(name = "[id]", columnDefinition = "bigint comment 'id'")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**学生名**/
    @Column(name = "[name]", columnDefinition = "varchar (50) comment '学生名'")
    private String name;

    /**年龄**/
    @Column(name = "[age]", columnDefinition = "int comment '年龄'")
    private Integer age;

    /**是否删除 0未删除**/
    @Column(name = "[has_del]", columnDefinition = "bigint default '0' comment '是否删除 0未删除'")
    @InsertDefault("0")
    private Long hasDel;

    /**租户id**/
    @Column(name = "[tenant_id]", columnDefinition = "varchar (20) comment '租户id'")
    private String tenantId;





}
